<?php
@ini_set('display_errors', 1);

echo 'upload';
$ftp_server="115.28.174.12"; 
$ftp_user_name="www"; 
$ftp_user_pass="DrPhDHnFY"; 
$file = "head_img/9_1403624772.png";//tobe uploaded 
$remote_file = "./9_1403624772.png"; 

// set up basic connection 
$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server"); 
echo 'upload';
// login with username and password 
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); 

// upload a file 
if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) { 
    echo "successfully uploaded $file\n"; 
    exit; 
} else { 
    echo "There was a problem while uploading $file\n"; 
    exit; 
    } 
// close the connection 
ftp_close($conn_id); 